#ifndef JFILEDEVICE_P_H
#define JFILEDEVICE_P_H

// W A R N I N G
// -------------
// This file is not JXQLIB-APIs

#include "jfiledevice.h"
#include "jabstractio_p.h"

namespace JXQ
{

class J_DECL_HIDDEN JFileDevicePrivate : public JAbstractIOPrivate
{
	J_DECLARE_PUBLIC(JFileDevice)

public:
	using JAbstractIOPrivate::JAbstractIOPrivate;

public:
	static inline bool isExist(const JString &name);
	bool openCheck(OpenMode mode) const;
	FILE *toFILE() const;

public:
	mutable std::mutex m_nameMutex;
	JString m_name;

#ifdef J_OS_WIN
	HANDLE m_handle;
#elif defined(J_OS_LINUX) || defined(J_OS_UNIX)
	int m_handle;
#endif
};

} //namespace JXQ


#endif //JFILEDEVICE_P_H
